package proxy.statics;

/**
 * 静态代理的局限性： 只能代理一类型的对象
 *
 */
public class Person implements Button {

    // 必须持有目标对象的句柄
    private Button button;

    public Person() {
    }

    public Person(Button button) {
        this.button = button;
    }

    @Override
    public void click(String name) {
        before();
        button.click(name);
        after();
    }

    public void before() {
        System.out.println("--------click start -----");
    }

    public void after() {
        System.out.println("--------click end--------");
    }
}
